<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="module-getpass.html" />
<link rel="prev" href="module-getopt.html" />
<link rel="parent" href="allos.html" />
<link rel="next" href="node405.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>14.5 logging -- Logging facility for Python</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="14.4 getopt  "
  href="module-getopt.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="14. generic Operating System"
  href="allos.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="14.5.1 logger Objects"
  href="node405.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-getopt.html">14.4 getopt  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="allos.html">14. Generic Operating System</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node405.html">14.5.1 Logger Objects</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h1><a name="SECTION0016500000000000000000">
14.5 <tt class="module">logging</tt> --
         Logging facility for Python</a>
</h1>

<p>
<a name="module-logging"></a>
<p>

<p>

<p>
<a id='l2h-2856' xml:id='l2h-2856'></a>
<p>

<span class="versionnote">New in version 2.3.</span>

This module defines functions and classes which implement a flexible
error logging system for applications.

<p>
Logging is performed by calling methods on instances of the
<tt class="class">Logger</tt> class (hereafter called <i class="dfn">loggers</i>). Each instance has a
name, and they are conceptually arranged in a name space hierarchy
using dots (periods) as separators. For example, a logger named
"scan" is the parent of loggers "scan.text", "scan.html" and "scan.pdf".
Logger names can be anything you want, and indicate the area of an
application in which a logged message originates.

<p>
Logged messages also have levels of importance associated with them.
The default levels provided are <tt class="constant">DEBUG</tt>, <tt class="constant">INFO</tt>,
<tt class="constant">WARNING</tt>, <tt class="constant">ERROR</tt> and <tt class="constant">CRITICAL</tt>. As a
convenience, you indicate the importance of a logged message by calling
an appropriate method of <tt class="class">Logger</tt>. The methods are
<tt class="method">debug()</tt>, <tt class="method">info()</tt>, <tt class="method">warning()</tt>, <tt class="method">error()</tt> and
<tt class="method">critical()</tt>, which mirror the default levels. You are not
constrained to use these levels: you can specify your own and use a
more general <tt class="class">Logger</tt> method, <tt class="method">log()</tt>, which takes an
explicit level argument.

<p>
The numeric values of logging levels are given in the following table. These
are primarily of interest if you want to define your own levels, and need
them to have specific values relative to the predefined levels. If you
define a level with the same numeric value, it overwrites the predefined
value; the predefined name is lost.

<p>
<div class="center"><table class="realtable">
  <thead>
    <tr>
      <th class="left"  >Level</th>
      <th class="left"  >Numeric value</th>
      </tr>
    </thead>
  <tbody>
    <tr><td class="left"   valign="baseline"><code>CRITICAL</code></td>
        <td class="left"  >50</td></tr>
    <tr><td class="left"   valign="baseline"><code>ERROR</code></td>
        <td class="left"  >40</td></tr>
    <tr><td class="left"   valign="baseline"><code>WARNING</code></td>
        <td class="left"  >30</td></tr>
    <tr><td class="left"   valign="baseline"><code>INFO</code></td>
        <td class="left"  >20</td></tr>
    <tr><td class="left"   valign="baseline"><code>DEBUG</code></td>
        <td class="left"  >10</td></tr>
    <tr><td class="left"   valign="baseline"><code>NOTSET</code></td>
        <td class="left"  >0</td></tr></tbody>
</table></div>

<p>
Levels can also be associated with loggers, being set either by the
developer or through loading a saved logging configuration. When a
logging method is called on a logger, the logger compares its own
level with the level associated with the method call. If the logger's
level is higher than the method call's, no logging message is actually
generated. This is the basic mechanism controlling the verbosity of
logging output.

<p>
Logging messages are encoded as instances of the <tt class="class">LogRecord</tt> class.
When a logger decides to actually log an event, a <tt class="class">LogRecord</tt>
instance is created from the logging message.

<p>
Logging messages are subjected to a dispatch mechanism through the
use of <i class="dfn">handlers</i>, which are instances of subclasses of the
<tt class="class">Handler</tt> class. Handlers are responsible for ensuring that a logged
message (in the form of a <tt class="class">LogRecord</tt>) ends up in a particular
location (or set of locations) which is useful for the target audience for
that message (such as end users, support desk staff, system administrators,
developers). Handlers are passed <tt class="class">LogRecord</tt> instances intended for
particular destinations. Each logger can have zero, one or more handlers
associated with it (via the <tt class="method">addHandler()</tt> method of <tt class="class">Logger</tt>).
In addition to any handlers directly associated with a logger,
<em>all handlers associated with all ancestors of the logger</em> are
called to dispatch the message.

<p>
Just as for loggers, handlers can have levels associated with them.
A handler's level acts as a filter in the same way as a logger's level does.
If a handler decides to actually dispatch an event, the <tt class="method">emit()</tt> method
is used to send the message to its destination. Most user-defined subclasses
of <tt class="class">Handler</tt> will need to override this <tt class="method">emit()</tt>.

<p>
In addition to the base <tt class="class">Handler</tt> class, many useful subclasses
are provided:

<p>

<ol>
<li><tt class="class">StreamHandler</tt> instances send error messages to
streams (file-like objects).

<p>
</li>
<li><tt class="class">FileHandler</tt> instances send error messages to disk
files.

<p>
</li>
<li><tt class="class">BaseRotatingHandler</tt> is the base class for handlers that
rotate log files at a certain point. It is not meant to be  instantiated
directly. Instead, use <tt class="class">RotatingFileHandler</tt> or
<tt class="class">TimedRotatingFileHandler</tt>.

<p>
</li>
<li><tt class="class">RotatingFileHandler</tt> instances send error messages to disk
files, with support for maximum log file sizes and log file rotation.

<p>
</li>
<li><tt class="class">TimedRotatingFileHandler</tt> instances send error messages to
disk files rotating the log file at certain timed intervals.

<p>
</li>
<li><tt class="class">SocketHandler</tt> instances send error messages to
TCP/IP sockets.

<p>
</li>
<li><tt class="class">DatagramHandler</tt> instances send error messages to UDP
sockets.

<p>
</li>
<li><tt class="class">SMTPHandler</tt> instances send error messages to a
designated email address.

<p>
</li>
<li><tt class="class">SysLogHandler</tt> instances send error messages to a
<span class="Unix">Unix</span> syslog daemon, possibly on a remote machine.

<p>
</li>
<li><tt class="class">NTEventLogHandler</tt> instances send error messages to a
Windows NT/2000/XP event log.

<p>
</li>
<li><tt class="class">MemoryHandler</tt> instances send error messages to a
buffer in memory, which is flushed whenever specific criteria are
met.

<p>
</li>
<li><tt class="class">HTTPHandler</tt> instances send error messages to an
HTTP server using either "<tt class="samp">GET</tt>" or "<tt class="samp">POST</tt>" semantics.

<p>
</li>
</ol>

<p>
The <tt class="class">StreamHandler</tt> and <tt class="class">FileHandler</tt> classes are defined
in the core logging package. The other handlers are defined in a sub-
module, <tt class="module">logging.handlers</tt>. (There is also another sub-module,
<tt class="module">logging.config</tt>, for configuration functionality.)

<p>
Logged messages are formatted for presentation through instances of the
<tt class="class">Formatter</tt> class. They are initialized with a format string
suitable for use with the % operator and a dictionary.

<p>
For formatting multiple messages in a batch, instances of
<tt class="class">BufferingFormatter</tt> can be used. In addition to the format string
(which is applied to each message in the batch), there is provision for
header and trailer format strings.

<p>
When filtering based on logger level and/or handler level is not enough,
instances of <tt class="class">Filter</tt> can be added to both <tt class="class">Logger</tt> and
<tt class="class">Handler</tt> instances (through their <tt class="method">addFilter()</tt> method).
Before deciding to process a message further, both loggers and handlers
consult all their filters for permission. If any filter returns a false
value, the message is not processed further.

<p>
The basic <tt class="class">Filter</tt> functionality allows filtering by specific logger
name. If this feature is used, messages sent to the named logger and its
children are allowed through the filter, and all others dropped.

<p>
In addition to the classes described above, there are a number of module-
level functions.

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2857' xml:id='l2h-2857' class="function">getLogger</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>name</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Return a logger with the specified name or, if no name is specified, return
a logger which is the root logger of the hierarchy. If specified, the name
is typically a dot-separated hierarchical name like <var>"a"</var>, <var>"a.b"</var>
or <var>"a.b.c.d"</var>. Choice of these names is entirely up to the developer
who is using logging.

<p>
All calls to this function with a given name return the same logger instance.
This means that logger instances never need to be passed between different
parts of an application.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2858' xml:id='l2h-2858' class="function">getLoggerClass</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Return either the standard <tt class="class">Logger</tt> class, or the last class passed to
<tt class="function">setLoggerClass()</tt>. This function may be called from within a new
class definition, to ensure that installing a customised <tt class="class">Logger</tt> class
will not undo customisations already applied by other code. For example:

<p>
<div class="verbatim"><pre>
 class MyLogger(logging.getLoggerClass()):
     # ... override behaviour here
</pre></div>

<p>
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2859' xml:id='l2h-2859' class="function">debug</tt></b>(</nobr></td>
  <td><var>msg</var><big>[</big><var>, *args</var><big>[</big><var>, **kwargs</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <tt class="constant">DEBUG</tt> on the root logger.
The <var>msg</var> is the message format string, and the <var>args</var> are the
arguments which are merged into <var>msg</var> using the string formatting
operator. (Note that this means that you can use keywords in the
format string, together with a single dictionary argument.)

<p>
There are two keyword arguments in <var>kwargs</var> which are inspected:
<var>exc_info</var> which, if it does not evaluate as false, causes exception
information to be added to the logging message. If an exception tuple (in the
format returned by <tt class="function">sys.exc_info()</tt>) is provided, it is used;
otherwise, <tt class="function">sys.exc_info()</tt> is called to get the exception
information.

<p>
The other optional keyword argument is <var>extra</var> which can be used to pass
a dictionary which is used to populate the __dict__ of the LogRecord created
for the logging event with user-defined attributes. These custom attributes
can then be used as you like. For example, they could be incorporated into
logged messages. For example:

<p>
<div class="verbatim"><pre>
 FORMAT = "%(asctime)-15s %(clientip)s %(user)-8s %(message)s"
 logging.basicConfig(format=FORMAT)
 dict = { 'clientip' : '192.168.0.1', 'user' : 'fbloggs' }
 logging.warning("Protocol problem: %s", "connection reset", extra=d)
</pre></div>

<p>
would print something like
<div class="verbatim"><pre>
2006-02-08 22:20:02,165 192.168.0.1 fbloggs  Protocol problem: connection reset
</pre></div>

<p>
The keys in the dictionary passed in <var>extra</var> should not clash with the keys
used by the logging system. (See the <tt class="class">Formatter</tt> documentation for more
information on which keys are used by the logging system.)

<p>
If you choose to use these attributes in logged messages, you need to exercise
some care. In the above example, for instance, the <tt class="class">Formatter</tt> has been
set up with a format string which expects 'clientip' and 'user' in the
attribute dictionary of the LogRecord. If these are missing, the message will
not be logged because a string formatting exception will occur. So in this
case, you always need to pass the <var>extra</var> dictionary with these keys.

<p>
While this might be annoying, this feature is intended for use in specialized
circumstances, such as multi-threaded servers where the same code executes
in many contexts, and interesting conditions which arise are dependent on this
context (such as remote client IP address and authenticated user name, in the
above example). In such circumstances, it is likely that specialized
<tt class="class">Formatter</tt>s would be used with particular <tt class="class">Handler</tt>s.

<p>

<span class="versionnote">Changed in version 2.5:
<var>extra</var> was added.</span>

<p>
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2860' xml:id='l2h-2860' class="function">info</tt></b>(</nobr></td>
  <td><var>msg</var><big>[</big><var>, *args</var><big>[</big><var>, **kwargs</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <tt class="constant">INFO</tt> on the root logger.
The arguments are interpreted as for <tt class="function">debug()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2861' xml:id='l2h-2861' class="function">warning</tt></b>(</nobr></td>
  <td><var>msg</var><big>[</big><var>, *args</var><big>[</big><var>, **kwargs</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <tt class="constant">WARNING</tt> on the root logger.
The arguments are interpreted as for <tt class="function">debug()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2862' xml:id='l2h-2862' class="function">error</tt></b>(</nobr></td>
  <td><var>msg</var><big>[</big><var>, *args</var><big>[</big><var>, **kwargs</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <tt class="constant">ERROR</tt> on the root logger.
The arguments are interpreted as for <tt class="function">debug()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2863' xml:id='l2h-2863' class="function">critical</tt></b>(</nobr></td>
  <td><var>msg</var><big>[</big><var>, *args</var><big>[</big><var>, **kwargs</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <tt class="constant">CRITICAL</tt> on the root logger.
The arguments are interpreted as for <tt class="function">debug()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2864' xml:id='l2h-2864' class="function">exception</tt></b>(</nobr></td>
  <td><var>msg</var><big>[</big><var>, *args</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <tt class="constant">ERROR</tt> on the root logger.
The arguments are interpreted as for <tt class="function">debug()</tt>. Exception info
is added to the logging message. This function should only be called
from an exception handler.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2865' xml:id='l2h-2865' class="function">log</tt></b>(</nobr></td>
  <td><var>level, msg</var><big>[</big><var>, *args</var><big>[</big><var>, **kwargs</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Logs a message with level <var>level</var> on the root logger.
The other arguments are interpreted as for <tt class="function">debug()</tt>.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2866' xml:id='l2h-2866' class="function">disable</tt></b>(</nobr></td>
  <td><var>lvl</var>)</td></tr></table></dt>
<dd>
Provides an overriding level <var>lvl</var> for all loggers which takes
precedence over the logger's own level. When the need arises to
temporarily throttle logging output down across the whole application,
this function can be useful.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2867' xml:id='l2h-2867' class="function">addLevelName</tt></b>(</nobr></td>
  <td><var>lvl, levelName</var>)</td></tr></table></dt>
<dd>
Associates level <var>lvl</var> with text <var>levelName</var> in an internal
dictionary, which is used to map numeric levels to a textual
representation, for example when a <tt class="class">Formatter</tt> formats a message.
This function can also be used to define your own levels. The only
constraints are that all levels used must be registered using this
function, levels should be positive integers and they should increase
in increasing order of severity.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2868' xml:id='l2h-2868' class="function">getLevelName</tt></b>(</nobr></td>
  <td><var>lvl</var>)</td></tr></table></dt>
<dd>
Returns the textual representation of logging level <var>lvl</var>. If the
level is one of the predefined levels <tt class="constant">CRITICAL</tt>,
<tt class="constant">ERROR</tt>, <tt class="constant">WARNING</tt>, <tt class="constant">INFO</tt> or <tt class="constant">DEBUG</tt>
then you get the corresponding string. If you have associated levels
with names using <tt class="function">addLevelName()</tt> then the name you have associated
with <var>lvl</var> is returned. If a numeric value corresponding to one of the
defined levels is passed in, the corresponding string representation is
returned. Otherwise, the string "Level %s" % lvl is returned.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2869' xml:id='l2h-2869' class="function">makeLogRecord</tt></b>(</nobr></td>
  <td><var>attrdict</var>)</td></tr></table></dt>
<dd>
Creates and returns a new <tt class="class">LogRecord</tt> instance whose attributes are
defined by <var>attrdict</var>. This function is useful for taking a pickled
<tt class="class">LogRecord</tt> attribute dictionary, sent over a socket, and reconstituting
it as a <tt class="class">LogRecord</tt> instance at the receiving end.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2870' xml:id='l2h-2870' class="function">basicConfig</tt></b>(</nobr></td>
  <td><var></var><big>[</big><var>**kwargs</var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
Does basic configuration for the logging system by creating a
<tt class="class">StreamHandler</tt> with a default <tt class="class">Formatter</tt> and adding it to
the root logger. The functions <tt class="function">debug()</tt>, <tt class="function">info()</tt>,
<tt class="function">warning()</tt>, <tt class="function">error()</tt> and <tt class="function">critical()</tt> will call
<tt class="function">basicConfig()</tt> automatically if no handlers are defined for the
root logger.

<p>

<span class="versionnote">Changed in version 2.4:
Formerly, <tt class="function">basicConfig</tt> did not take any keyword
arguments.</span>

<p>
The following keyword arguments are supported.

<p>
<div class="center"><table class="realtable">
  <thead>
    <tr>
      <th class="left"  >Format</th>
      <th class="left"  >Description</th>
      </tr>
    </thead>
  <tbody>
    <tr><td class="left"   valign="baseline"><code>filename</code></td>
        <td class="left"  >Specifies that a FileHandler be created, using the
specified filename, rather than a StreamHandler.</td></tr>
    <tr><td class="left"   valign="baseline"><code>filemode</code></td>
        <td class="left"  >Specifies the mode to open the file, if filename is
specified (if filemode is unspecified, it defaults to 'a').</td></tr>
    <tr><td class="left"   valign="baseline"><code>format</code></td>
        <td class="left"  >Use the specified format string for the handler.</td></tr>
    <tr><td class="left"   valign="baseline"><code>datefmt</code></td>
        <td class="left"  >Use the specified date/time format.</td></tr>
    <tr><td class="left"   valign="baseline"><code>level</code></td>
        <td class="left"  >Set the root logger level to the specified level.</td></tr>
    <tr><td class="left"   valign="baseline"><code>stream</code></td>
        <td class="left"  >Use the specified stream to initialize the StreamHandler.
Note that this argument is incompatible with 'filename' - if both
are present, 'stream' is ignored.</td></tr></tbody>
</table></div>

<p>
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2871' xml:id='l2h-2871' class="function">shutdown</tt></b>(</nobr></td>
  <td><var></var>)</td></tr></table></dt>
<dd>
Informs the logging system to perform an orderly shutdown by flushing and
closing all handlers.
</dl>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><tt id='l2h-2872' xml:id='l2h-2872' class="function">setLoggerClass</tt></b>(</nobr></td>
  <td><var>klass</var>)</td></tr></table></dt>
<dd>
Tells the logging system to use the class <var>klass</var> when instantiating a
logger. The class should define <tt class="method">__init__()</tt> such that only a name
argument is required, and the <tt class="method">__init__()</tt> should call
<tt class="method">Logger.__init__()</tt>. This function is typically called before any
loggers are instantiated by applications which need to use custom logger
behavior.
</dl>

<p>
<div class="seealso">
  <p class="heading">See Also:</p>

  <dl compact="compact" class="seerfc">
    <dt><a href="http://www.python.org/peps/pep-0282.html"
        title="A logging System"
        >PEP 282, <em>A Logging System</em></a>
    <dd>The proposal which described this feature for inclusion in
          the Python standard library.
  </dl>
  <dl compact="compact" class="seeurl">
    <dt><a href='http://www.red-dove.com/python_logging.html'
        >Original Python <tt class="module">logging</tt> package</a></dt>
    <dd>This is the original source for the <tt class="module">logging</tt>
           package.  The version of the package available from this
           site is suitable for use with Python 1.5.2, 2.1.x and 2.2.x,
           which do not include the <tt class="module">logging</tt> package in the standard
           library.</dd>
  </dl>
</div>

<p>

<p><br /></p><hr class='online-navigation' />
<div class='online-navigation'>
<!--Table of Child-Links-->
<a name="CHILD_LINKS"><strong>Subsections</strong></a>

<ul class="ChildLinks">
<li><a href="node405.html">14.5.1 Logger Objects</a>
<li><a href="node406.html">14.5.2 Basic example</a>
<li><a href="multiple-destinations.html">14.5.3 Logging to multiple destinations</a>
<li><a href="network-logging.html">14.5.4 Sending and receiving logging events across a network</a>
<li><a href="node409.html">14.5.5 Handler Objects</a>
<ul>
<li><a href="node410.html">14.5.5.1 StreamHandler</a>
<li><a href="node411.html">14.5.5.2 FileHandler</a>
<li><a href="node412.html">14.5.5.3 RotatingFileHandler</a>
<li><a href="node413.html">14.5.5.4 TimedRotatingFileHandler</a>
<li><a href="node414.html">14.5.5.5 SocketHandler</a>
<li><a href="node415.html">14.5.5.6 DatagramHandler</a>
<li><a href="node416.html">14.5.5.7 SysLogHandler</a>
<li><a href="node417.html">14.5.5.8 NTEventLogHandler</a>
<li><a href="node418.html">14.5.5.9 SMTPHandler</a>
<li><a href="node419.html">14.5.5.10 MemoryHandler</a>
<li><a href="node420.html">14.5.5.11 HTTPHandler</a>
</ul>
<li><a href="node421.html">14.5.6 Formatter Objects</a>
<li><a href="node422.html">14.5.7 Filter Objects</a>
<li><a href="node423.html">14.5.8 LogRecord Objects</a>
<li><a href="node424.html">14.5.9 Thread Safety</a>
<li><a href="node425.html">14.5.10 Configuration</a>
<ul>
<li><a href="logging-config-api.html">14.5.10.1 Configuration functions</a>
<li><a href="logging-config-fileformat.html">14.5.10.2 Configuration file format</a>
</ul></ul>
<!--End of Table of Child-Links-->
</div>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="14.4 getopt  "
  href="module-getopt.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="14. generic Operating System"
  href="allos.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="14.5.1 logger Objects"
  href="node405.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-getopt.html">14.4 getopt  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="allos.html">14. Generic Operating System</a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node405.html">14.5.1 Logger Objects</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
